package com.mysteel.cyx.demo.biz.export;


import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author Vicky(陈烟星)
 * @date 2024/6/25 17:51
 */
public enum WarnOperationEnum {
    WARNING(1,"预警"),
    FORBIDDEN(2,"禁止"),
    ;

    private final Integer warnOperation;
    private final String warnOperationDesc;

    WarnOperationEnum(Integer warnOperation, String warnOperationDesc) {
        this.warnOperation = warnOperation;
        this.warnOperationDesc = warnOperationDesc;
    }

    public Integer getWarnOperation() {
        return warnOperation;
    }

    public String getWarnOperationDesc() {
        return warnOperationDesc;
    }


    private static final Map<Integer, WarnOperationEnum> map = Arrays.stream(values()).collect(Collectors.toMap(
            WarnOperationEnum::getWarnOperation,
            e -> e
    ));
    public static WarnOperationEnum fromWarnOperation(Integer warnOperation) {
        return map.get(warnOperation);
    }

}
